﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace DefeatEpidemic.RequestModels
{
    public class CommonModel
    {
    }
    /// <summary>
    /// 登录请求对象
    /// </summary>
    public class LoginRequestModel
    {
        /// <summary>
        /// 登录时获取的 code （参数1）
        /// </summary>
        [Required]
        public string loginCode { get; set; }
        /// <summary>
        /// 微信昵称
        /// </summary>
        public string nick_name { get; set; }
        /// <summary>
        /// 微信头像
        /// </summary>
        public string avatar { get; set; }
    }

    /// <summary>
    /// 注册身份模型
    /// </summary>
    public class MemberModel
    {
        /// <summary>
        /// 姓名
        /// </summary>
        [Required(ErrorMessage ="{0}为必填项")]
        public string name { get; set; }
        /// <summary>
        /// 身份证
        /// </summary>
        //[Required(ErrorMessage = "{0}为必填项")]
        public string idcard { get; set; }
        /// <summary>
        /// 手机
        /// </summary>
        [Required(ErrorMessage = "{0}为必填项")]
        public string mobile { get; set; }
        /// <summary>
        /// 社区识别码(在小程序码的sence参数中)
        /// </summary>
        [Required(ErrorMessage = "{0}为必填项")]
        public string code { get; set; }
        /// <summary>
        /// 门牌号
        /// </summary>
        [Required(ErrorMessage = "{0}为必填项")]
        public string houseNumber { get; set; }

        /// <summary>
        /// 车牌号（没有可不填）
        /// </summary>
        public string carNumber { get; set; }

        /// <summary>
        /// 微信授权后的openid
        /// </summary>
        public string open_id { get; set; }
    }

    /// <summary>
    /// 绑定管理员模型
    /// </summary>
    public class ManagerModel
    {
        /// <summary>
        /// 手机号
        /// </summary>
        [Required]
        public string mobile { get; set; }

        /// <summary>
        /// 微信授权后的openid
        /// </summary>
        [Required]
        public string open_id { get; set; }
    }

    /// <summary>
    /// 申请出入
    /// </summary>
    public class ApplyModel
    {
        /// <summary>
        /// 人员id
        /// </summary>
        [Required(ErrorMessage = "{0}为必填")]
        public Guid member_id { get; set; }
        /// <summary>
        /// 目的地
        /// </summary>
        [Required(ErrorMessage = "{0}为必填")]
        public string target { get; set; }
        /// <summary>
        /// 出行原因
        /// </summary>
        [Required(ErrorMessage ="{0}为必填")]
        public string reason { get; set; }
        /// <summary>
        /// 自测体温（可不填）
        /// </summary>        
        public float temp { get; set; } = 0;
        /// <summary>
        /// 是否开车0-不开，1-开
        /// </summary>
        public int isDirve { get; set; } = 0;

        /// <summary>
        /// open_id,用以推送消息
        /// </summary>        
        public string open_id { get; set; }
        /// <summary>
        /// 出行时间（物管人员扫描时更新）
        /// </summary>
        //public DateTime outTime { get; set; } = DateTime.Now;
    }

    /// <summary>
    /// 出入申请审批模型
    /// </summary>
    public class CheckModel
    {
        /// <summary>
        /// 申请id
        /// </summary>
        [Required]
        public Guid app_id { get; set; }

        /// <summary>
        /// 实测体温
        /// </summary>
        [Required]
        public float temp { get; set; }
        /// <summary>
        /// 是否允许，1-允许，-1-不允许
        /// </summary>
        [Required]
        public int status { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string remark { get; set; }
        /// <summary>
        /// 审查人员
        /// </summary>
        [Required]
        public Guid checker_id { get; set; }

        
    }
}
